#include <iostream>
#include <pthread.h>

#include "Client.h"

using namespace std;

int main()
{
    WSADATA wsaData;
    WSAStartup(MAKEWORD(2, 2), &wsaData);

    if (Client::getSingleClient()->startListen() != 0)
    {
        std::cerr << "exit" << std::endl;
        exit(-1);
    }

    pthread_t pid;
    pthread_create(&pid, NULL, Client::thread_accept, (void *)Client::getSingleClient());

    Client::getSingleClient()->startCon();

    Client::getSingleClient()->stopListen();

    WSACleanup();
    return 0;
}
